#include "BinaryTree.h"

int main (int argc, char *argv[])
{
    BinaryTree<int> A;
    BinaryTree<int> B;
    B.insert(2);
    B.insert(3);
    B.updateDepthandPos();
    std::cout << "B:" << std::endl;
    B.display();
    BinaryTree<int>::Node *t = new BinaryTree<int>::Node(7);
    A.insert(t);   /// ???
    A.updateDepthandPos();
    std::cout << "A:" << std::endl;
    A.display();
    const BinaryTree<int>::Node *r = A.search(7);
    std::cout << "r->data:" << r->data << std::endl;
    BinaryTree<int>::Node *s = A.search(7);
    std::cout << "s->data:" << s->data << std::endl;
    BinaryTree<int>::Node *p = A.search(6);
    std::cout << "p->data:" << p->data << std::endl;
    const BinaryTree<int>::Node *q = A.search(6);
    std::cout << "q->data:" << p->data << std::endl;
    s = B.min();
    std::cout << "min of B:" << s->data << std::endl;
    s = B.max();
    std::cout << "max of B:" << s->data << std::endl;
    s = B.min(B.getRoot());
    std::cout << "min of B:" << s->data << std::endl;
    s = B.max(B.getRoot());
    std::cout << "max of B:" << s->data << std::endl;
    B.insert(7);
    B.insert(5);
    B.insert(1);
    B.insert(1);
    B.insert(8);
    B.insert(6);
    B.insert(9);
    B.updateDepthandPos();
    std::cout << "B:" << std::endl;
    B.display();
    B.del(B.getRoot()->right->right);
    std::cout << "B:" << std::endl;
    B.display();
    return 0;
};
